
const constants = require('../../../common/Constants.js');
const network_utils = require('../../../http/NetworkUtils.js');
const umfToast = require('../../../utils/UmfToast');

Page({
    onSubmit: function (event) {
        let content = event.detail.value.content;
        if (content) {
            this._requestFeedBack(content);
        }else {
            //弹出提示消息
        }
    },

    _requestFeedBack: function (content) {
        let params = {
            feedBack: content
        };
        network_utils.buildRequest(constants.Interfaces.FUNC_FEEDBACK_ADD, params, {
            doHttpSucess: (data) => {
                if (constants.RetCodes.SUCCESS === data.retCode) {
                    umfToast.showToast('感谢您的反馈');
                    setTimeout(()=> {
                        wx.navigateBack({delta: 1});
                    }, 1000);
                }
                return false;
            }
        }).send();
    },
});